<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Glance Design Dashboard an Admin Panel Category Flat Bootstrap Responsive Website Template | Forms ::
        w3layouts</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="Glance Design Dashboard Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design"/>
    <script type="application/x-javascript"> addEventListener("load", function () {
        setTimeout(hideURLbar, 0);
    }, false);

    function hideURLbar() {
        window.scrollTo(0, 1);
    } </script>

    <!-- Bootstrap Core CSS -->
    <link th:href="@{/css/bootstrap.css}" rel='stylesheet' type='text/css'/>

    <!-- Custom CSS -->
    <link th:href="@{/css/style.css}" rel='stylesheet' type='text/css'/>

    <!-- font-awesome icons CSS -->
    <link th:href="@{/css/font-awesome.css}" rel='stylesheet' type='text/css'/>
    <!-- //font-awesome icons CSS -->

    <!-- side nav css file -->
    <link th:href="@{/css/SidebarNav.min.css}" rel='stylesheet' type='text/css'/>
    <!-- side nav css file -->

    <!-- js-->
    <script th:src="@{/js/jquery-1.11.1.min.js}"></script>
    <script th:src="@{/js/modernizr.custom.js}"></script>

    <!--webfonts-->
    <link href="//fonts.googleapis.com/css?family=PT+Sans:400,400i,700,700i&amp;subset=cyrillic,cyrillic-ext,latin-ext"
          rel="stylesheet">
    <!--//webfonts-->

    <!-- Metis Menu -->
    <script th:src="@{/js/metisMenu.min.js}"></script>
    <script th:src="@{/js/custom.js}"></script>
    <link th:href="@{/css/custom.css}" rel='stylesheet' type='text/css'/>
    <!--//Metis Menu -->

</head>
<body class="cbp-spmenu-push">
<div class="main-content">
    <div class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
        <!--left-fixed -navigation-->
        <aside class="sidebar-left">
            <nav class="navbar navbar-inverse">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".collapse"
                            aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <h1><a class="navbar-brand" th:href="@{/}"><span class="fa fa-area-chart"></span>ONLINE<span
                            class="dashboard_text">Online Judge</span></a></h1>
                </div>
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="sidebar-menu">
                        <li class="header">MAIN NAVIGATION</li>
                        <li class="treeview">
                            <a th:href="@{/}">
                                <i class="fa fa-dashboard"></i> <span>个人中心</span>
                            </a>
                        </li>
                        <li class="treeview">
                            <a th:href="@{/questions/all}">
                                <i class="fa fa-laptop"></i>
                                <span>查看题目</span>
                            </a>
                        </li>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </nav>
        </aside>
    </div>
    <!--left-fixed -navigation-->

    <!-- header-starts -->
    <div class="sticky-header header-section ">
        <div class="header-left">
            <!--toggle button start-->
            <button id="showLeftPush"><i class="fa fa-bars"></i></button>
            <!--toggle button end-->
            <div class="profile_details_left"><!--notifications of menu start -->
                <ul class="nofitications-dropdown">
                    <li class="dropdown head-dpdn">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i
                                class="fa fa-envelope"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <!--notification menu end -->
            <div class="clearfix"></div>
        </div>
        <div class="header-right">

            <div class="profile_details">
                <ul>
                    <li class="dropdown profile_details_drop">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                            <div class="profile_img">
                                <span class="fa fa-users"> </span>
                                <div class="user-name">
                                    <p th:each="cookie: ${#request.getCookies()}"
                                       th:if="${cookie.getName()} == username" th:text="${cookie.getValue()}">
                                        &nbsp;
                                        <span th:text="${#request.getCookies()}"></span>
                                    </p>
                                    <span th:each="cookie: ${#request.getCookies()}"
                                          th:if="${cookie.getName()} == status" th:switch="${cookie.getValue()}">
                                        <span th:case="0">普通用户</span>
                                        <span th:case="1">管理员</span>
                                        <span th:case="-2">普通用户请注册</span>
                                    </span>
                                </div>
                                <i class="fa fa-angle-down lnr"></i>
                                <i class="fa fa-angle-up lnr"></i>
                                <div class="clearfix"></div>
                            </div>
                        </a>
                        <ul class="dropdown-menu drp-mnu" th:each="cookie: ${#request.getCookies()}"
                            th:if="${cookie.getName() == 'status' && cookie.getValue() == '-2'}">
                            <li><a th:href="@{/login}"><i class="fa fa-sign-in"></i> 登录</a></li>
                            <li><a th:href="@{/register}"><i class="fa fa-registered"></i> 注册</a></li>
                        </ul>
                        <ul class="dropdown-menu drp-mnu" th:each="cookie: ${#request.getCookies()}"
                            th:if="${cookie.getName() == 'status' && cookie.getValue() != '-2'}">
                            <li><a th:href="@{/logout}"><i class="fa fa-sign-out"></i>退出登录</a></li>
                            <li><a th:href="@{/}"><i class="fa fa-user"></i>个人中心</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
    </div>
    <!-- //header-ends -->
    <!-- main content start-->
    <div id="page-wrapper">
        <div class="main-page">
            <div class="forms">
                <div class="row">
                    <div class="form-three widget-shadow">
                        <form class="form-horizontal"
                              th:action="${que == null} ? @{/questions/add}: @{/questions/update}" method="post">
                            <input type="hidden" hidden name="qid" th:if="${que != null}" th:value="${que.getQid()}">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">题目标题</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control1" name="title"
                                           placeholder="Default Input" th:if="${que != null}"
                                           th:value="${que.getTitle()}">
                                    <input type="text" class="form-control1" name="title" th:if="${que == null}"
                                           placeholder="Default Input">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">题目详细描述</label>
                                <div class="col-sm-8">
                                    <textarea class="form-control1" name="description"
                                              style="resize: none; height: 200px;" th:if="${que != null}"
                                              th:text="${que.getDescription()}"></textarea>
                                    <textarea class="form-control1" name="description"
                                              style="resize: none; height: 200px;" th:if="${que == null}"></textarea>
                                </div>
                            </div>
                            <div class="form-group mb-n">
                                <label class="col-sm-2 control-label label-input-lg"></label>
                                <div class="col-sm-8">
                                    <input type="submit" class="form-control1 input-lg"
                                           style="background: gray;color: cyan;">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="row" th:if="${que != null}">
                    <div class="form-three widget-shadow">
                        <div class="col-md-12">
                            <span class="col-md-4"></span>
                            <h4 class="col-md-4">添加测试用例 <br>
                                <span style="color: red">ps: 输入用例文件后缀为in， 输出用例文件后缀为out</span>
                            </h4>
                            <span class="col-md-4"></span>
                        </div>
                        <form class="form-horizontal" th:action="@{/test/case/upload}" method="post"
                              enctype="multipart/form-data">
                            <input type="hidden" hidden name="qid" th:value="${que.getQid()}">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">点击右侧上传文件</label>
                                <div class="col-sm-8">
                                    <input type="file" class="form-control1" name="files" multiple="multiple">
                                </div>
                            </div>
                            <div class="form-group mb-n">
                                <label class="col-sm-2 control-label label-input-lg"></label>
                                <div class="col-sm-8">
                                    <input type="submit" class="form-control1 input-lg"
                                           style="background: gray;color: pink;" value="上传">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="table-responsive bs-example widget-shadow" th:if="${que != null}">
                    <h3>Responsive Table:</h3>
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>输入</th>
                            <th>输出</th>
                            <th>删除</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="testCase : ${testCases}">
                            <td th:text="${testCase.getIn()}"></td>
                            <td th:text="${testCase.getOut()}"></td>
                            <td>
                                <a th:href="@{/test/case/delete/} + ${testCase.getTid()}">
                                    <span class="glyphicon glyphicon-trash"></span>
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--footer-->
    <div class="footer">
        <p>&copy; 2018 Glance Design Dashboard. All Rights Reserved | Design by <a href="https://w3layouts.com/"
                                                                                   target="_blank">w3layouts</a></p>
    </div>
    <!--//footer-->
</div>

<!-- side nav js -->
<script th:src="@{/js/SidebarNav.min.js}"></script><!---->
<script>
    $('.sidebar-menu').SidebarNav()
</script>
<!-- //side nav js -->

<!-- Classie --><!-- for toggle left push menu script -->
<script th:src="@{/js/classie.js}"></script>
<script>
    var menuLeft = document.getElementById('cbp-spmenu-s1'),
        showLeftPush = document.getElementById('showLeftPush'),
        body = document.body;

    showLeftPush.onclick = function () {
        classie.toggle(this, 'active');
        classie.toggle(body, 'cbp-spmenu-push-toright');
        classie.toggle(menuLeft, 'cbp-spmenu-open');
        disableOther('showLeftPush');
    };

    function disableOther(button) {
        if (button !== 'showLeftPush') {
            classie.toggle(showLeftPush, 'disabled');
        }
    }
</script>
<!-- //Classie --><!-- //for toggle left push menu script -->

<!--scrolling js-->
<script th:src="@{/js/jquery.nicescroll.js}"></script>
<script th:src="@{/js/scripts.js}"></script>
<!--//scrolling js-->

<!-- Bootstrap Core JavaScript -->
<script th:src="@{/js/bootstrap.js}"></script>

</body>
</html>